﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RelationExpertSystem.Relation
{
    public class Step_Son : RelationBase
    {
        private static Step_Son _singleton = new Step_Son();
        public static Step_Son Instance
        {
            get { return _singleton; }
        }

        private Step_Son() { }

        public override bool IsRelated(Person a, Person b)
        {
            // b is a's Step_Son IFF b is male AND b is a's Step child
            return b.Sex == Sex.Male && a.KnownRelation(Step_Child.Instance, b);
        }

        public override IEnumerable<IRelation> GetDependencies()
        {
            return new HashSet<IRelation>(new IRelation[] { Step_Child.Instance });
        }
    }
}
